import request from '@/utils/request'

// 创建患者信息
export function createPatient(data) {
  return request({
    url: '/main/patient/create',
    method: 'post',
    data: data
  })
}

// 更新患者信息
export function updatePatient(data) {
  return request({
    url: '/main/patient/update',
    method: 'put',
    data: data
  })
}

// 删除患者信息
export function deletePatient(id) {
  return request({
    url: '/main/patient/delete?id=' + id,
    method: 'delete'
  })
}

// 获得患者信息
export function getPatient(id) {
  return request({
    url: '/main/patient/get?id=' + id,
    method: 'get'
  })
}

// 获得患者信息分页
export function getPatientPage(query) {
  return request({
    url: '/main/patient/page',
    method: 'get',
    params: query
  })
}

// 导出患者信息 Excel
export function exportPatientExcel(query) {
  return request({
    url: '/main/patient/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
